package com.sunxu.jvm.classloader;

import com.apple.laf.AquaButtonCheckBoxUI;
import com.sunxu.jvm.classdef.Hello;

/**
 * @author 孙许
 * @version 1.0
 * @date 2020/7/20 21:57
 */
public class ClassLoaderStudy {

    public static void main(String[] args) throws ClassNotFoundException {
        String str = "Hello world";
        System.out.println(str.getClass().getClassLoader());

        Class<?> driver = Class.forName("java.sql.Driver");
        System.out.println(new Hello().getClass().getClassLoader());
        System.out.println(new Hello().getClass().getClassLoader().getParent());
        System.out.println(new Hello().getClass().getClassLoader().getParent().getParent());
        System.out.println(new Hello().getClass().getClassLoader().getParent().getParent().getParent());
    }
}
